//
//  MOS6510.h
//  C64
//
//  Created by Antonio "Willy" Malara on 19/04/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "C64Memory.h"

typedef enum {
	MOS6510OperandMemoryAddress,
	MOS6510OperandImmediateValue,
	MOS6510OperandImplied
} MOS6510OperandType;

typedef struct {
	MOS6510OperandType type;
	unsigned short     value;
} MOS6510Operand;

@interface MOS6510 : NSObject
{
	unsigned char A; 
	unsigned char X; 
	unsigned char Y; 
	unsigned char PCL;
	unsigned char PCH;
	unsigned char S;
	unsigned char P;
	
	C64Memory * memory;
}

@property(nonatomic, assign) unsigned char	A;
@property(nonatomic, assign) unsigned char	X;
@property(nonatomic, assign) unsigned char	Y;
@property(nonatomic, assign) unsigned char	PCH;
@property(nonatomic, assign) unsigned char	PCL;
@property(nonatomic, assign) unsigned char	S;
@property(nonatomic, assign) unsigned char	P;

@property(nonatomic, assign) unsigned short PC;

@property(nonatomic, assign) BOOL carryBit;
@property(nonatomic, assign) BOOL zeroBit;
@property(nonatomic, assign) BOOL irqMaskBit;
@property(nonatomic, assign) BOOL decimalModeBit;
@property(nonatomic, assign) BOOL brkBit;
@property(nonatomic, assign) BOOL overflowBit;
@property(nonatomic, assign) BOOL negativeBit;

@property(nonatomic, assign) C64Memory * memory;

- (void)reset;
- (void)step;

@end
